<?php
require_once("global.php");

$cateid = 17;

$id = intval($id);
//如果不存在ID时
if(!$id || $id == "0")
{
	$id = $cateid;
}

//当前分类信息
$thiscate = $PA->thiscate($id);
if(!$thiscate)
{
	qgheader();
}
$navid = $sign = $thiscate["sysgroup_sign"];

//根分类
$rootcate = $PA->rootcate($id);

//兼容三级分类
$upcate = $PA->upcate($thiscate["id"]);
$upid = $upcate["id"];
if($upid==$rootcate["id"])
{
	$upid = $thiscate["id"];
}

//当前位置
if($thiscate["id"]!=$rootcate["id"])
{
	$fid = $thiscate["id"];
}

//网页标题
$sitetitle = $thiscate["meta_title".$bi] ? $thiscate["meta_title".$bi] : $thiscate["catename".$bi]." - ".$system["sitename".$bi];
$system["keywords"] = $rs["meta_keywords".$bi] ? $rs["meta_keywords".$bi] : $system["keywords".$bi];
$system["description"] = $rs["meta_description".$bi] ? $rs["meta_description".$bi] : $system["description".$bi];

//设定每页显示数量
$rootcate["psize"] = $thiscate["psize"] ? $thiscate["psize"] : $rootcate["psize"];
$psize = $rootcate["psize"] ? $rootcate["psize"] : 12;

//分页链接
$pageurl = $sign.".php?id=".$id;

//获取分页ID
$pageid = intval($pageid);
if($pageid < 1)
{
	$pageid = 1;
}
$offset = $pageid > 0 ? ($pageid-1)*$psize : 0;

//等于0时获取普通产品,等于1获取新品,等于2时获取新品和普通产品
$isvouch = 0;

//标题显示字数
$cut1 = 38;

//内容显示字数
$cut2 = 110;

//其他条件
$where = array("like"=>"");

//获取总数
$msgcount = $PA->msgcount($id,$isvouch,$where);

//当前分类内容
$msglist = $PA->msglist($id,$cut1,$cut2,$offset,$psize,$isvouch,$where);

//分页
$pagelist = page($pageurl,$bi,$msgcount,$psize,$pageid);

if($thiscate["tpl_index"])
{
	$tpl_file = $thiscate["tpl_index"];
}
else
{
	if($thiscate["tpl_list"])
	{
		$tpl_file = $thiscate["tpl_list"];
	}
	else
	{
		$tpl_file = $sign.".list";
	}
}
FOOT($tpl_file);
?>